package com.yangweiqiao.fastindex;



/**
 * Created by ccy on 2016/8/20.
 */
public class Contact implements Comparable<Contact>{
	private String name;
	private String firstLetter;

	public Contact(String name, String firstLetter) {
		this.name = name;
		this.firstLetter = HanYuPinYinUtil.chineseWordToPinyin(firstLetter).substring(0,1);
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getFirstLetter() {
		return firstLetter;
	}

	public void setFirstLetter(String firstLetter) {
		this.firstLetter = firstLetter;
	}

	@Override
	public String toString() {
		return "Contact{" +
				"name='" + name + '\'' +
				", firstLetter='" + firstLetter + '\'' +
				'}';
	}

	@Override
	public int compareTo(Contact another) {
		return this.firstLetter.compareTo(another.firstLetter);
	}
}
